import java.util.Scanner;

public class 交换瓶子 {
    //交换瓶子
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] nums = new int[n + 1];
        int res = 0;
        for (int i = 1; i <= n; i++) {
            nums[i] = scan.nextInt();
        }
        for (int i = 1; i <= n; i++) {
            if (nums[i] != i) {
                //去找正确的
                for (int j = i; j <= n;j++) {
                    if (nums[j] == i) {
                        //交换
                        int temp = nums[i];
                        nums[i] = i;
                        nums[j] = temp;
                        res++;
                        break;
                    }

                }
            }
        }
        System.out.println(res);
    }
}